var province_json=[{"code":"410000000000","name":"河南省"}];
var city_json={"01":[{"code":"410100000000","name":"郑州"}]};
var country_json={
	"410100000000":[
		{
			"code":"410171000000",
			"name":"郑州经济技术开发区"
		},
		{
			"code":"410172000000",
			"name":"郑州高新技术产业开发区"
		},
		{
			"code":"410173000000",
			"name":"郑州航空港经济综合实验区"
		},
		{
			"code":"410103000000",
			"name":"二七区"
		},
		{
			"code":"410181000000",
			"name":"巩义市"
		},
		{
			"code":"410182000000",
			"name":"荥阳市"
		},
		{
			"code":"410183000000",
			"name":"新密市"
		},
		{
			"code":"410184000000",
			"name":"新郑市"
		},
		{
			"code":"410185000000",
			"name":"登封市"
		},
		{
			"code":"410101000000",
			"name":"市辖区"
		},
		{
			"code":"410104000000",
			"name":"管城回族区"
		},
		{
			"code":"410102000000",
			"name":"中原区"
		},
		{
			"code":"410105000000",
			"name":"金水区"
		},
		{
			"code":"410106000000",
			"name":"上街区"
		},
		{
			"code":"410108000000",
			"name":"惠济区"
		},
		{
			"code":"410122000000",
			"name":"中牟县"
		}
	]
};
var town_json={
	"410106000000": [
		{
			"code": "410106001000",
			"name": "济源路街道办事处"
		},
		{
			"code": "410106002000",
			"name": "中心路街道办事处"
		},
		{
			"code": "410106003000",
			"name": "新安路街道办事处"
		},
		{
			"code": "410106004000",
			"name": "工业路街道办事处"
		},
		{
			"code": "410106005000",
			"name": "矿山街道办事处"
		},
		{
			"code": "410106100000",
			"name": "峡窝镇"
		}
	],
	"410105000000": [
		{
			"code": "410105001000",
			"name": "经八路街道办事处"
		},
		{
			"code": "410105002000",
			"name": "花园路街道办事处"
		},
		{
			"code": "410105003000",
			"name": "人民路街道办事处"
		},
		{
			"code": "410105004000",
			"name": "杜岭街道办事处"
		},
		{
			"code": "410105005000",
			"name": "大石桥街道办事处"
		},
		{
			"code": "410105006000",
			"name": "南阳路街道办事处"
		},
		{
			"code": "410105007000",
			"name": "南阳新村街道办事处"
		},
		{
			"code": "410105008000",
			"name": "文化路街道办事处"
		},
		{
			"code": "410105009000",
			"name": "丰产路街道办事处"
		},
		{
			"code": "410105010000",
			"name": "东风路街道办事处"
		},
		{
			"code": "410105011000",
			"name": "北林路街道办事处"
		},
		{
			"code": "410105012000",
			"name": "未来路街道办事处"
		},
		{
			"code": "410105013000",
			"name": "凤凰台街道办事处"
		},
		{
			"code": "410105014000",
			"name": "龙子湖街道办事处"
		},
		{
			"code": "410105015000",
			"name": "祭城路街道办事处"
		},
		{
			"code": "410105016000",
			"name": "兴达路街道办事处"
		},
		{
			"code": "410105017000",
			"name": "国基路街道办事处"
		},
		{
			"code": "410105018000",
			"name": "杨金路街道办事处"
		},
		{
			"code": "410105019000",
			"name": "丰庆路街道办事处"
		},
		{
			"code": "410105560000",
			"name": "如意湖街道办事处"
		},
		{
			"code": "410105561000",
			"name": "博学路街道办事处"
		},
		{
			"code": "410105562000",
			"name": "龙湖街道办事处"
		},
		{
			"code": "410105563000",
			"name": "龙源路街道办事处"
		},
		{
			"code": "410105564000",
			"name": "金光路街道办事处"
		}
	],
	"410183000000": [
		{
			"code": "410183001000",
			"name": "青屏街街道办事处"
		},
		{
			"code": "410183002000",
			"name": "新华路街道办事处"
		},
		{
			"code": "410183003000",
			"name": "西大街街道办事处"
		},
		{
			"code": "410183100000",
			"name": "城关镇"
		},
		{
			"code": "410183101000",
			"name": "米村镇"
		},
		{
			"code": "410183102000",
			"name": "牛店镇"
		},
		{
			"code": "410183103000",
			"name": "平陌镇"
		},
		{
			"code": "410183104000",
			"name": "超化镇"
		},
		{
			"code": "410183105000",
			"name": "苟堂镇"
		},
		{
			"code": "410183106000",
			"name": "大隗镇"
		},
		{
			"code": "410183107000",
			"name": "刘寨镇"
		},
		{
			"code": "410183108000",
			"name": "白寨镇"
		},
		{
			"code": "410183109000",
			"name": "岳村镇"
		},
		{
			"code": "410183110000",
			"name": "来集镇"
		},
		{
			"code": "410183113000",
			"name": "曲梁镇"
		},
		{
			"code": "410183200000",
			"name": "袁庄乡"
		},
		{
			"code": "410183400000",
			"name": "矿区街道办事处"
		},
		{
			"code": "410183401000",
			"name": "尖山风景区管理委员会"
		},
		{
			"code": "410183402000",
			"name": "郑州曲梁产业集聚区管理委员会"
		}
	],
	"410173000000": [
		{
			"code": "410173108000",
			"name": "张庄镇"
		},
		{
			"code": "410173113000",
			"name": "八岗镇"
		},
		{
			"code": "410173116000",
			"name": "三官庙镇"
		},
		{
			"code": "410173202000",
			"name": "八千乡"
		},
		{
			"code": "410173203000",
			"name": "龙王乡"
		},
		{
			"code": "410173400000",
			"name": "新港办事处"
		},
		{
			"code": "410173401000",
			"name": "郑港办事处"
		},
		{
			"code": "410173404000",
			"name": "银河办事处"
		},
		{
			"code": "410173405000",
			"name": "明港办事处"
		},
		{
			"code": "410173580000",
			"name": "滨河办事处"
		},
		{
			"code": "410173581000",
			"name": "冯堂办事处"
		},
		{
			"code": "410173582000",
			"name": "清河办事处"
		},
		{
			"code": "410173583000",
			"name": "龙港办事处"
		}
	],
	"410181000000": [
		{
			"code": "410181001000",
			"name": "新华路街道办事处"
		},
		{
			"code": "410181002000",
			"name": "杜甫路街道办事处"
		},
		{
			"code": "410181003000",
			"name": "永安路街道办事处"
		},
		{
			"code": "410181004000",
			"name": "孝义街道办事处"
		},
		{
			"code": "410181005000",
			"name": "紫荆路街道办事处"
		},
		{
			"code": "410181100000",
			"name": "米河镇"
		},
		{
			"code": "410181101000",
			"name": "新中镇"
		},
		{
			"code": "410181102000",
			"name": "小关镇"
		},
		{
			"code": "410181103000",
			"name": "竹林镇"
		},
		{
			"code": "410181104000",
			"name": "大峪沟镇"
		},
		{
			"code": "410181105000",
			"name": "河洛镇"
		},
		{
			"code": "410181106000",
			"name": "站街镇"
		},
		{
			"code": "410181108000",
			"name": "康店镇"
		},
		{
			"code": "410181110000",
			"name": "北山口镇"
		},
		{
			"code": "410181111000",
			"name": "西村镇"
		},
		{
			"code": "410181112000",
			"name": "芝田镇"
		},
		{
			"code": "410181113000",
			"name": "回郭镇"
		},
		{
			"code": "410181114000",
			"name": "鲁庄镇"
		},
		{
			"code": "410181115000",
			"name": "夹津口镇"
		},
		{
			"code": "410181116000",
			"name": "涉村镇"
		}
	],
	"410102000000": [
		{
			"code": "410102010000",
			"name": "中原西路街道办事处"
		},
		{
			"code": "410102011000",
			"name": "西流湖街道办事处"
		},
		{
			"code": "410102012000",
			"name": "须水街道办事处"
		},
		{
			"code": "410102002000",
			"name": "建设路街道办事处"
		},
		{
			"code": "410102003000",
			"name": "棉纺路街道办事处"
		},
		{
			"code": "410102004000",
			"name": "秦岭路街道办事处"
		},
		{
			"code": "410102005000",
			"name": "桐柏路街道办事处"
		},
		{
			"code": "410102001000",
			"name": "林山寨街道办事处"
		},
		{
			"code": "410102006000",
			"name": "三官庙街道办事处"
		},
		{
			"code": "410102007000",
			"name": "绿东村街道办事处"
		},
		{
			"code": "410102008000",
			"name": "汝河路街道办事处"
		},
		{
			"code": "410102009000",
			"name": "航海西路街道办事处"
		}
	],
	"410122000000": [
		{
			"code": "410122102000",
			"name": "官渡镇"
		},
		{
			"code": "410122103000",
			"name": "狼城岗镇"
		},
		{
			"code": "410122104000",
			"name": "万滩镇"
		},
		{
			"code": "410122105000",
			"name": "白沙镇"
		},
		{
			"code": "410122106000",
			"name": "郑庵镇"
		},
		{
			"code": "410122109000",
			"name": "黄店镇"
		},
		{
			"code": "410122110000",
			"name": "大孟镇"
		},
		{
			"code": "410122112000",
			"name": "刘集镇"
		},
		{
			"code": "410122114000",
			"name": "雁鸣湖镇"
		},
		{
			"code": "410122115000",
			"name": "姚家镇"
		},
		{
			"code": "410122208000",
			"name": "刁家乡"
		},
		{
			"code": "410122570000",
			"name": "杨桥办事处"
		},
		{
			"code": "410122571000",
			"name": "豫兴办事处"
		},
		{
			"code": "410122001000",
			"name": "青年路街道办事处"
		},
		{
			"code": "410122002000",
			"name": "东风路街道办事处"
		},
		{
			"code": "410122003000",
			"name": "广惠街街道办事处"
		},
		{
			"code": "410122101000",
			"name": "韩寺镇"
		}
	],
	"410172000000": [
		{
			"code": "410172160000",
			"name": "石佛镇"
		},
		{
			"code": "410172360000",
			"name": "沟赵乡"
		},
		{
			"code": "410172560000",
			"name": "枫杨办事处"
		},
		{
			"code": "410172561000",
			"name": "梧桐办事处"
		},
		{
			"code": "410172562000",
			"name": "双桥办事处"
		}
	],
	"410182000000": [
		{
			"code": "410182001000",
			"name": "索河街道办事处"
		},
		{
			"code": "410182002000",
			"name": "京城路街道办事处"
		},
		{
			"code": "410182101000",
			"name": "乔楼镇"
		},
		{
			"code": "410182102000",
			"name": "豫龙镇"
		},
		{
			"code": "410182103000",
			"name": "广武镇"
		},
		{
			"code": "410182104000",
			"name": "王村镇"
		},
		{
			"code": "410182105000",
			"name": "汜水镇"
		},
		{
			"code": "410182106000",
			"name": "高山镇"
		},
		{
			"code": "410182108000",
			"name": "刘河镇"
		},
		{
			"code": "410182109000",
			"name": "崔庙镇"
		},
		{
			"code": "410182110000",
			"name": "贾峪镇"
		},
		{
			"code": "410182200000",
			"name": "城关乡"
		},
		{
			"code": "410182201000",
			"name": "高村乡"
		},
		{
			"code": "410182204000",
			"name": "金寨回族乡"
		}
	],
	"410185000000": [
		{
			"code": "410185001000",
			"name": "嵩阳街道办事处"
		},
		{
			"code": "410185002000",
			"name": "少林街道办事处"
		},
		{
			"code": "410185003000",
			"name": "中岳街道办事处"
		},
		{
			"code": "410185100000",
			"name": "大金店镇"
		},
		{
			"code": "410185101000",
			"name": "颍阳镇"
		},
		{
			"code": "410185102000",
			"name": "卢店镇"
		},
		{
			"code": "410185103000",
			"name": "告成镇"
		},
		{
			"code": "410185104000",
			"name": "阳城区镇"
		},
		{
			"code": "410185105000",
			"name": "大冶镇"
		},
		{
			"code": "410185106000",
			"name": "宣化镇"
		},
		{
			"code": "410185107000",
			"name": "徐庄镇"
		},
		{
			"code": "410185108000",
			"name": "东华镇"
		},
		{
			"code": "410185109000",
			"name": "唐庄镇"
		},
		{
			"code": "410185202000",
			"name": "白坪乡"
		},
		{
			"code": "410185203000",
			"name": "君召乡"
		},
		{
			"code": "410185204000",
			"name": "石道乡"
		},
		{
			"code": "410185400000",
			"name": "送表矿区"
		}
	],
	"410103000000": [
		{
			"code": "410103001000",
			"name": "淮河路街道办事处"
		},
		{
			"code": "410103002000",
			"name": "解放路街道办事处"
		},
		{
			"code": "410103003000",
			"name": "铭功路街道办事处"
		},
		{
			"code": "410103004000",
			"name": "一马路街道办事处"
		},
		{
			"code": "410103005000",
			"name": "蜜蜂张街道办事处"
		},
		{
			"code": "410103006000",
			"name": "五里堡街道办事处"
		},
		{
			"code": "410103007000",
			"name": "大学路街道办事处"
		},
		{
			"code": "410103008000",
			"name": "建中街街道办事处"
		},
		{
			"code": "410103009000",
			"name": "福华街街道办事处"
		},
		{
			"code": "410103010000",
			"name": "德化街街道办事处"
		},
		{
			"code": "410103011000",
			"name": "嵩山路街道办事处"
		},
		{
			"code": "410103012000",
			"name": "京广路街道办事处"
		},
		{
			"code": "410103013000",
			"name": "长江路街道办事处"
		},
		{
			"code": "410103015000",
			"name": "人和路街道办事处"
		},
		{
			"code": "410103016000",
			"name": "侯寨街道办事处"
		},
		{
			"code": "410103100000",
			"name": "马寨镇"
		}
	],
	"410108000000": [
		{
			"code": "410108001000",
			"name": "新城街道办事处"
		},
		{
			"code": "410108002000",
			"name": "刘寨街道办事处"
		},
		{
			"code": "410108003000",
			"name": "江山路街道办事处"
		},
		{
			"code": "410108004000",
			"name": "长兴路街道办事处"
		},
		{
			"code": "410108005000",
			"name": "迎宾路街道办事处"
		},
		{
			"code": "410108006000",
			"name": "大河路街道办事处"
		},
		{
			"code": "410108100000",
			"name": "花园口镇"
		},
		{
			"code": "410108101000",
			"name": "古荥镇"
		}
	],
	"410171000000": [
		{
			"code": "410171111000",
			"name": "九龙镇"
		},
		{
			"code": "410171560000",
			"name": "经济开发区明湖街道办事处"
		},
		{
			"code": "410171561000",
			"name": "经济开发区潮河街道办事处"
		},
		{
			"code": "410171562000",
			"name": "京航街道办事处"
		},
		{
			"code": "410171563000",
			"name": "前程办事处"
		},
		{
			"code": "410171565000",
			"name": "祥云办事处"
		}
	],
	"410104000000": [
		{
			"code": "410104001000",
			"name": "北下街街道办事处"
		},
		{
			"code": "410104002000",
			"name": "西大街街道办事处"
		},
		{
			"code": "410104003000",
			"name": "南关街道办事处"
		},
		{
			"code": "410104004000",
			"name": "城东路街道办事处"
		},
		{
			"code": "410104005000",
			"name": "东大街街道办事处"
		},
		{
			"code": "410104006000",
			"name": "二里岗街道办事处"
		},
		{
			"code": "410104007000",
			"name": "陇海马路街道办事处"
		},
		{
			"code": "410104008000",
			"name": "紫荆山南路街道办事处"
		},
		{
			"code": "410104009000",
			"name": "航海东路街道办事处"
		},
		{
			"code": "410104010000",
			"name": "十八里河街道办事处"
		},
		{
			"code": "410104201000",
			"name": "南曹乡"
		},
		{
			"code": "410104202000",
			"name": "圃田乡"
		},
		{
			"code": "410104570000",
			"name": "商都路街道办事处"
		}
	],
	"410184000000": [
		{
			"code": "410184001000",
			"name": "新建路街道办事处"
		},
		{
			"code": "410184002000",
			"name": "新华路街道办事处"
		},
		{
			"code": "410184003000",
			"name": "新烟街道办事处"
		},
		{
			"code": "410184101000",
			"name": "新村镇"
		},
		{
			"code": "410184102000",
			"name": "辛店镇"
		},
		{
			"code": "410184103000",
			"name": "观音寺镇"
		},
		{
			"code": "410184104000",
			"name": "梨河镇"
		},
		{
			"code": "410184105000",
			"name": "和庄镇"
		},
		{
			"code": "410184106000",
			"name": "薛店镇"
		},
		{
			"code": "410184107000",
			"name": "孟庄镇"
		},
		{
			"code": "410184108000",
			"name": "郭店镇"
		},
		{
			"code": "410184109000",
			"name": "龙湖镇"
		},
		{
			"code": "410184200000",
			"name": "城关乡"
		},
		{
			"code": "410184402000",
			"name": "具茨山国家级森林公园管理委员会"
		},
		{
			"code": "410184403000",
			"name": "中心城区新区建设管理委员会"
		}
	]
};
var hall_code_json={"410171000000":"zz_jkq","410184000000":"zz_xz","410182000000":"zz_xy"};

var thisCode='';
function initCity(provinceCode,name){
	$("#areaCountryDiv").hide();
	$("#areaTownDiv").hide();
	hallCode=hall_code_json[provinceCode];
	thisCode=provinceCode;
	$(".areaSelectDiv").show();
	$(".areaSpanSplit1").hide();
	$(".areaSpanSplit2").hide();
	var arr=city_json[provinceCode];
	if(arr!=null&&arr.length>0){
		var html="";
		for(var i=0;i<arr.length;i++){
			html+='<a onclick="initCountry(\''+arr[i].code+'\',\''+arr[i].name+'\')">'+arr[i].name+'</a>';
		}
		$("#areaCityDiv").html(html);
		$("#areaCountryDiv").html("");
		$("#areaTownDiv").html("");
	}
}

function initCountry(cityCode,name){
	$("#areaCountryDiv").show();
	$("#areaTownDiv").hide();
	hallCode=hall_code_json[cityCode];
	thisCode=cityCode;
	$(".areaSpanSplit1").hide();
	$(".areaSpanSplit2").hide();
	$("#citySpan").text(name);
	$("#countrySpan").text("");
	$("#townSpan").text("");
	var arr=country_json[cityCode];
	if(arr!=null&&arr.length>0){
		var html="";
		for(var i=0;i<arr.length;i++){
			html+='<a onclick="initTown(\''+arr[i].code+'\',\''+arr[i].name+'\')">'+arr[i].name+'</a>';
		}
		$("#areaCountryDiv").html(html);
		$("#areaTownDiv").html("");
	}
}

function initTown(countryCode,name){
	$("#areaCountryDiv").show();
	$("#areaTownDiv").show();
	hallCode=hall_code_json[countryCode];
	thisCode=countryCode;
	$("#countrySpan").text(name);
	$("#townSpan").text("");
	$(".areaSpanSplit1").show();
	$(".areaSpanSplit2").hide();
	var arr=town_json[countryCode];
	if(arr!=null&&arr.length>0){
		var html="";
		for(var i=0;i<arr.length;i++){
			html+='<a onclick="setTownName(\''+arr[i].code+'\',\''+arr[i].name+'\')">'+arr[i].name+'</a>';
		}
		$("#areaTownDiv").html(html);
	}
}

function setTownName(townCode,name){
	hallCode=hall_code_json[townCode];
	thisCode=townCode;
	$(".areaSpanSplit1").show();
	$(".areaSpanSplit2").show();
	$("#townSpan").text(name);
}

function confirmArea(){
	$(".areaSelectDiv").hide();
	initPageData();
}

function cutstr(str, len) {
	if(len<0||str==null||str.length<=len){
		return str;
	}
	return str.substring(0,len);
}